﻿<phone:PhoneApplicationPage
    x:Class="Organizer.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape"  Orientation="Portrait"
    shell:SystemTray.IsVisible="True"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    toolkit:TiltEffect.IsTiltEnabled="True"
    xmlns:my="clr-namespace:Organizer" >
    <!--d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"-->
    <toolkit:TransitionService.NavigationInTransition>
        <toolkit:NavigationInTransition>
            <toolkit:NavigationInTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardIn"/>
            </toolkit:NavigationInTransition.Backward>
            <toolkit:NavigationInTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardIn"/>
            </toolkit:NavigationInTransition.Forward>
        </toolkit:NavigationInTransition>
    </toolkit:TransitionService.NavigationInTransition>
    <toolkit:TransitionService.NavigationOutTransition>
        <toolkit:NavigationOutTransition>
            <toolkit:NavigationOutTransition.Backward>
                <toolkit:TurnstileTransition Mode="BackwardOut"/>
            </toolkit:NavigationOutTransition.Backward>
            <toolkit:NavigationOutTransition.Forward>
                <toolkit:TurnstileTransition Mode="ForwardOut"/>
            </toolkit:NavigationOutTransition.Forward>
        </toolkit:NavigationOutTransition>
    </toolkit:TransitionService.NavigationOutTransition>
    <!--Data context is set to sample data above and LayoutRoot contains the root grid where all other page content is placed-->


    <!--ресурсы страгницы. Определяем DataTemplate-->
    <phone:PhoneApplicationPage.Resources>
        <DataTemplate x:Key="CustomItemTemplate">
            <StackPanel x:Name="sp">
                <StackPanel Orientation="Horizontal">
                    <!--<CheckBox HorizontalAlignment="Left" IsChecked="{Binding IsSelectedMultiSelect, Mode=TwoWay}" 
                              Visibility="{Binding ElementName=Page, Path=DataContext.Status, Converter={StaticResource manageSelectionStateToVisibilityConverter}}" />-->
                    <StackPanel>
                        <TextBlock Text="{Binding Name}" Style="{StaticResource PhoneTextAccentLargeStyle}" />
                        <TextBlock Text="{Binding Description}" Style="{StaticResource TextLighter}" />
                        <!--<i:Interaction.Triggers>
                            <i:EventTrigger EventName="Tap">
                                <cmd:EventToCommand Command="{Binding ElementName=Page, Path=DataContext.EditCommand}" CommandParameter="{Binding}" />
                            </i:EventTrigger>
                        </i:Interaction.Triggers>-->
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </DataTemplate>
    </phone:PhoneApplicationPage.Resources>

    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->


        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,0,12,0">
            <controls:Pivot Title="{Binding Path=LocalizedResources.AppName, Source={StaticResource LocalizedStrings}}">
                <controls:PivotItem Header="main">
                    <ScrollViewer>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <my:TiltableGrid  Margin="12,12,5,5" Grid.Row="0" Grid.Column="0" Height="173" Width="173">
                                <toolkit:HubTile x:Name="hubMen" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left"
                                     Title="{Binding Path=LocalizedResources.MainPage_hubMenTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.MainPage_hubMenMessage, Source={StaticResource LocalizedStrings}}">
                                    <!--Source="/Images/men_small.jpg" >-->
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinGroups"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Tap">
                                            <cmd:EventToCommand Command="{Binding ToMans}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </toolkit:HubTile>
                            </my:TiltableGrid >
                            <my:TiltableGrid  Margin="6,12,6,6" Grid.Row="0" Grid.Column="1" Width="173" Height="173" >
                                <toolkit:HubTile x:Name="hubOrganizations" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left" 
                                     Title="{Binding Path=LocalizedResources.MainPage_hubOrganizationsTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.MainPage_hubOrganizationsMessage, Source={StaticResource LocalizedStrings}}"
                                     toolkit:TiltEffect.IsTiltEnabled="True" >
                                    <!--Source="/Images/organizations_small.jpg"-->
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinOrganizations" />
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Tap">
                                            <cmd:EventToCommand Command="{Binding ToOrganizations}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                </toolkit:HubTile>
                            </my:TiltableGrid >
                            <my:TiltableGrid  Margin="12,6,6,6" Grid.Row="1" Grid.Column="0" Width="173" Height="173">
                                <toolkit:HubTile x:Name="hubNotes" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left" 
                                     Title="{Binding Path=LocalizedResources.MainPage_hubNotesTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.MainPage_hubNotesMessage, Source={StaticResource LocalizedStrings}}">
                                    <!--Source="/Images/notes_small.jpg">-->
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Tap">
                                            <cmd:EventToCommand Command="{Binding ToNoteList}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinNotes">
                                                <i:Interaction.Triggers>
                                                    <i:EventTrigger EventName="Tap">
                                                        <cmd:EventToCommand Command="{Binding PinToStartNotesCommand}" />
                                                    </i:EventTrigger>
                                                </i:Interaction.Triggers>
                                            </toolkit:MenuItem>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </toolkit:HubTile>
                            </my:TiltableGrid >
                            <my:TiltableGrid  Margin="6" Grid.Row="1" Grid.Column="1" Width="173" Height="173">
                                <toolkit:HubTile x:Name="hubTasks" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left" 
                                     Title="{Binding Path=LocalizedResources.MainPage_hubTasksTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.MainPage_hubTasksMessage, Source={StaticResource LocalizedStrings}}">
                                    <!--Source="/Images/tasks_small.jpg">-->
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Tap">
                                            <cmd:EventToCommand Command="{Binding ToTaskList}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinTasks"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </toolkit:HubTile>
                            </my:TiltableGrid >
                            <my:TiltableGrid  Margin="12,6,6,6" Grid.Row="2" Grid.Column="0" Width="173" Height="173">
                                <toolkit:HubTile x:Name="hubCategories" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left" 
                                     Title="{Binding Path=LocalizedResources.MainPage_hubCategoriesTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.MainPage_hubCategoriesMessage, Source={StaticResource LocalizedStrings}}">
                                    <!--Source="/Images/tasks_small.jpg"-->
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Tap">
                                            <cmd:EventToCommand Command="{Binding ToCategoryList}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                    <toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinCategories"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>
                                </toolkit:HubTile>
                            </my:TiltableGrid >
                            <my:TiltableGrid  Margin="6" Grid.Row="2" Grid.Column="1" Width="173" Height="173">
                                <toolkit:HubTile x:Name="hubSettings" Background="{StaticResource PhoneAccentBrush}" Height="173" Width="173" HorizontalAlignment="Left" 
                                     Title="{Binding Path=LocalizedResources.MainPage_hubSettingsTitle, Source={StaticResource LocalizedStrings}}" 
                                     Message="{Binding Path=LocalizedResources.MainPage_hubSettingsMessage, Source={StaticResource LocalizedStrings}}">
                                    <!--Source="/Images/tasks_small.jpg"-->
                                    <i:Interaction.Triggers>
                                        <i:EventTrigger EventName="Tap">
                                            <cmd:EventToCommand Command="{Binding ToSettings}" />
                                        </i:EventTrigger>
                                    </i:Interaction.Triggers>
                                    <!--<toolkit:ContextMenuService.ContextMenu>
                                        <toolkit:ContextMenu>
                                            <toolkit:MenuItem Header="{Binding Path=LocalizedResources.MainPage_htPinToStartContext, Source={StaticResource LocalizedStrings}}" x:Name="miPinCategories"/>
                                        </toolkit:ContextMenu>
                                    </toolkit:ContextMenuService.ContextMenu>-->
                                </toolkit:HubTile>
                            </my:TiltableGrid >
                        </Grid>
                    </ScrollViewer>
                </controls:PivotItem>

                <controls:PivotItem Header="recent tasks">
                    <StackPanel>
                        <ItemsControl x:Name="multiSelectList"  ItemTemplate="{StaticResource CustomItemTemplate}" ItemsSource="{Binding Tasks}" >
                        </ItemsControl>
                    </StackPanel>
                </controls:PivotItem>
            </controls:Pivot>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>